#!/bin/bash

f=1
# while [ $f -eq 1 ]
while [ : ]
do
    read -n 1 -p "please input char: " ch

    echo

    case $ch in
        [[:upper:]])
            echo '大写字母'
            ;;
        [[:lower:]])
            echo '小写字母'
            ;;
        [[:digit:]])
            echo '纯数字'
            ;;
        [[:punct:]])
            echo '标点符号'
            ;;
        *)
            echo '非法字符'
            f=0
            break
            ;;
    esac
done
